from django.contrib import admin
from .models import MCPServer, MCPServerFromReadme, MCPServerTag

@admin.register(MCPServer)
class MCPServerAdmin(admin.ModelAdmin):
    list_display = ('name', 'status', 'owner', 'created_at')
    list_filter = ('status', 'category')
    search_fields = ('name', 'description')
    readonly_fields = ('created_at', 'updated_at')

@admin.register(MCPServerFromReadme)
class MCPServerFromReadmeAdmin(admin.ModelAdmin):
    list_display = ('name', 'provider', 'category_name', 'is_official')
    list_filter = ('category', 'is_official')
    search_fields = ('name', 'provider', 'description')

@admin.register(MCPServerTag)
class MCPServerTagAdmin(admin.ModelAdmin):
    list_display = ('server', 'tag')
    list_filter = ('tag',)
    search_fields = ('server__name', 'tag')
